package com.ruoyi.project.relation.domain.builder;

import com.ruoyi.project.relation.domain.BusinessLink;
import com.ruoyi.project.relation.domain.dto.BusinessRelationDO;
import com.ruoyi.project.relation.domain.qo.BusinessLinkQO;

/**
 *
 **/
public final class BusinessLinkQOBuilder {
    private Long sourceOwnerId;
    private String sourceOwnerName;
    private String sourceOwnerType;
    private Long ancestorOwnerId;
    private String ancestorOwnerName;
    private String ancestorOwnerType;
    private Integer level;

    private Integer selfLinkFlag;

    private BusinessLinkQOBuilder() {
    }


    public static BusinessLinkQOBuilder newBusinessLinkQO() {
        return new BusinessLinkQOBuilder();
    }

    public BusinessLinkQOBuilder sourceOwner(BusinessRelationDO sourceOwner){
        sourceOwnerType(sourceOwner.getOwnerType())
                .sourceOwnerId(sourceOwner.getOwnerId())
                .sourceOwnerName(sourceOwner.getOwnerName());
        return this;
    }

    public BusinessLinkQOBuilder ancestorOwner(BusinessRelationDO ancestorOwner){
        ancestorOwnerType(ancestorOwner.getOwnerType())
                .ancestorOwnerId(ancestorOwner.getOwnerId())
                .ancestorOwnerName(ancestorOwner.getOwnerName());
        return this;
    }



    public BusinessLinkQOBuilder sourceOwnerId(Long sourceOwnerId) {
        this.sourceOwnerId = sourceOwnerId;
        return this;
    }

    public BusinessLinkQOBuilder sourceOwnerName(String sourceOwnerName) {
        this.sourceOwnerName = sourceOwnerName;
        return this;
    }

    public BusinessLinkQOBuilder sourceOwnerType(String sourceOwnerType) {
        this.sourceOwnerType = sourceOwnerType;
        return this;
    }

    public BusinessLinkQOBuilder ancestorOwnerId(Long ancestorOwnerId) {
        this.ancestorOwnerId = ancestorOwnerId;
        return this;
    }

    public BusinessLinkQOBuilder ancestorOwnerName(String ancestorOwnerName) {
        this.ancestorOwnerName = ancestorOwnerName;
        return this;
    }

    public BusinessLinkQOBuilder ancestorOwnerType(String ancestorOwnerType) {
        this.ancestorOwnerType = ancestorOwnerType;
        return this;
    }

    public BusinessLinkQOBuilder level(Integer level) {
        this.level = level;
        return this;
    }

    public BusinessLinkQOBuilder selfLinkFlag(Integer selfLinkFlag) {
        this.selfLinkFlag = selfLinkFlag;
        return this;
    }

    public BusinessLinkQO build() {
        BusinessLinkQO businessLinkQO = new BusinessLinkQO();
        businessLinkQO.setSourceOwnerId(sourceOwnerId);
        businessLinkQO.setSourceOwnerName(sourceOwnerName);
        businessLinkQO.setSourceOwnerType(sourceOwnerType);
        businessLinkQO.setAncestorOwnerId(ancestorOwnerId);
        businessLinkQO.setAncestorOwnerName(ancestorOwnerName);
        businessLinkQO.setAncestorOwnerType(ancestorOwnerType);
        businessLinkQO.setLevel(level);
        businessLinkQO.setSelfLinkFlag(selfLinkFlag);
        return businessLinkQO;
    }

    public BusinessLink buildBusinessLink() {
        BusinessLink businessLink = new BusinessLink();
        businessLink.setSourceOwnerId(sourceOwnerId);
        businessLink.setSourceOwnerName(sourceOwnerName);
        businessLink.setSourceOwnerType(sourceOwnerType);
        businessLink.setAncestorOwnerId(ancestorOwnerId);
        businessLink.setAncestorOwnerName(ancestorOwnerName);
        businessLink.setAncestorOwnerType(ancestorOwnerType);
        businessLink.setLevel(level);
        businessLink.setSelfLinkFlag(selfLinkFlag);
        return businessLink;
    }

}
